#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{		
	int fd = open("numuc.dat",O_WRONLY | O_CREAT | O_TRUNC , 0666);
	if(fd == -1) perror("open") , exit(-1);
	int buf[10000] = {};
	for(int i = 1 ; i < 1000000 ; ++i)
	{
		buf[i % 10000] = i ;
		if((i % 10000) == 9999)
			write(fd,buf,sizeof(buf));
	}
	close(fd);
}
